import { axios } from '@/utils/request'

// api接口列表
const api = {
  list: '/order/list',
  detail: '/order/detail',
  makeorder: '/order/addOrderNew',
  getpayway: '/order/getPayMethodOption',
  cancelOrder: '/order/cancleOrderNew',
  finishorder: '/order/completeOrderNew',
  messagecount: '/order_message/noread ',
  messagelist: '/order_message/getlist',
  allread: '/order_message/setallread',
  bigtype: '/GoodCategory/list',
  smalltype: '/GoodCategory/categroryChild',
  getgoods: 'GoodCategory/getGoodsList',
  pospal:'api/pospal/getPospalData'

}
// 刷新库存
export function pospal (params) {
  return axios({
    url: api.pospal,
    method: 'post',
    params
  })
}
// 商品信息
export function getgoods (params) {
  return axios({
    url: api.getgoods,
    method: 'get',
    params
  })
}
// 2级分类

export function smalltype (params) {
  return axios({
    url: api.smalltype,
    method: 'get',
    params
  })
}
// 一级分类

export function bigtype (params) {
  return axios({
    url: api.bigtype,
    method: 'get',
    params
  })
}
// 已读消息
export function allread (data) {
  return axios({
    url: api.allread,
    method: 'post',
    data
  })
}
// 消息列表
export function messagelist (data) {
  return axios({
    url: api.messagelist,
    method: 'post',
    data
  })
}

// 未读数量
export function messagecount (data) {
  return axios({
    url: api.messagecount,
    method: 'post',
    data
  })
}
// 完成订单

export function finishorder (data) {
  return axios({
    url: api.finishorder,
    method: 'post',
    data
  })
}
// 取消订单cancel

export function cancelOrder (params) {
  return axios({
    url: api.cancelOrder,
    method: 'get',
    params
  })
}
// 获取支付方式筛选列表

  export function getpayway (params) {
    return axios({
      url: api.getpayway,
      method: 'get',
      params
    })
  }

// 列表记录
export function makeorder (data) {
  return axios({
    url: api.makeorder,
    method: 'post',
    data
  })
}

// 列表记录
export function list (params) {
  return axios({
    url: api.list,
    method: 'get',
    params
  })
}

// 订单详情
export function detail (params) {
  return axios({
    url: api.detail,
    method: 'get',
    params
  })
}

// 订单导出
export function exports (params) {
  return axios({
    url: api.detail,
    method: 'get',
    params
  })
}
